home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / backup / dds2tar-.000 / dds2tar-2.4.12.tar / dds2tar-2.4.12 / Makefile < prev    next >
Makefile  |  1996-03-28  |  6KB  |  221 lines

  1. # Makefile for dds2tar
  2. #
  3. #--------------------------------------------------------
  4. # To compile everything:                     make
  5. # To install the executables and man pages:  make install
  6. #--------------------------------------------------------
  7.  
  8. # Here are some configurable options:
  9. ################################################################
  10.  
  11. # To enable the use of the log pages of an HPDAT,
  12. # uncomment the following line :
  13. HPDAT=-DHPDAT
  14.  
  15. # Default tape device is: /dev/nst0
  16. # edit or uncomment the following line to change the default device
  17. DEVICE=/dev/rmt0
  18.  
  19. # The tape blocks are read into a buffer, so the buffer of dds2tar
  20. # should be in the same size as the one in /usr/src/linux/driver/scsi/st.c
  21. # of the kernel code. Set ST_BUFFER_BLOCKS to zero, in order to take the
  22. # size from the kernel source directly.
  23. #
  24. # The number is halved, if EOVERFLOW is detected.
  25. # The value of the kernel is normally ST_BUFFER_BLOCKS=32.
  26. #
  27. # To configure the buffer size of dds2tar
  28. # change or uncomment the following line :
  29. # BUFFER=-DST_BUFFER_BLOCKS=32
  30. BUFFER=-DST_BUFFER_BLOCKS=0
  31.  
  32. # To include some experimental stuff
  33. # uncomment the following line :
  34. # EXP_STUFF=-DEXP_STUFF
  35.  
  36. # change this to where you want to install:
  37. BINDIR=/usr/bin
  38. MANDIR=/usr/man
  39. MANEXT=1
  40.  
  41. # place here your favorite C compiler and options
  42. CC=cc
  43. CCOPT=$(HPDAT) $(HPDAT4) $(EXP_STUFF) $(MATCH) $(BUFFER) \
  44.       -DDEVICE=\"$(DEVICE)\" -O4 -Wall
  45.  
  46. #        -Wall \
  47. #        -Wstrict-prototypes \
  48. #        -Wshadow \
  49. #        -Wwrite-strings \
  50. #        -Wpointer-arith \
  51. #        -Wcast-qual \
  52. #        -Wenum-clash \
  53. #        -Wcast-align \
  54. #        -Wtraditional \
  55. #        -Wmissing-prototypes \
  56. #        -Wnested-externs \
  57. #        -Winline \
  58. #        -pedantic \
  59.  
  60.  
  61. # nothing configurable below this line
  62. ################################################################
  63.  
  64. .SUFFIXES: .c .o .man .$(MANEXT) .ps .s
  65.  
  66. V=2.4.12
  67. D=dds2tar-${V}
  68. T=tar-1.11.8
  69.  
  70. CCFLAGS=-DVERSION=\"$V\"
  71.  
  72. TAR=tar
  73. ARCHIVE=\
  74. $(D)/Makefile \
  75. $(D)/Changes \
  76. $(D)/README \
  77. $(D)/dds2tar.man \
  78. $(D)/dds2index.man \
  79. $(D)/mt-dds.man \
  80. $(D)/dds-dd.man \
  81. $(D)/dds2tar.ps \
  82. $(D)/dds2index.ps \
  83. $(D)/mt-dds.ps \
  84. $(D)/dds-dd.ps \
  85. $(D)/dds2tar.h \
  86. $(D)/dds2tar.c \
  87. $(D)/dds_extract.c \
  88. $(D)/zf-cre-open.h \
  89. $(D)/zf-cre-open.c \
  90. $(D)/dds_index.c \
  91. $(D)/dds_tape.h \
  92. $(D)/dds_tape.c \
  93. $(D)/dds_chkhdr.c \
  94. $(D)/tar-1.11.2.patch \
  95. $(D)/tar-1.11.8.patch \
  96. $(D)/tar-1.11.2-sparse-files.patch \
  97. $(D)/tar-1.11.2-sparse-files.README \
  98. $(D)/dds2tar-test.sh \
  99. $(D)/index-of-tar \
  100. $(D)/index-of-tar-v \
  101. $(D)/index-of-tar-2 \
  102. $(D)/index-of-dds2index \
  103. $(D)/.indent.pro \
  104. $(D)/dds2tar.lsm \
  105. $(D)/COPYING \
  106. $(D)/ddstool \
  107.  
  108.  
  109. OBJ= dds_index.o dds_extract.o dds_tape.o \
  110.      zf-cre-open.o dds_chkhdr.o
  111.  
  112.  
  113. all: dds2tar dds2tar.1 dds2index.1 mt-dds.1 dds-dd.1
  114.  
  115. dds2tar: dds2tar.o $(OBJ)
  116.     $(CC) dds2tar.o $(OBJ)  -o dds2tar
  117.     ln -f dds2tar dds2index
  118.     ln -f dds2tar mt-dds
  119.     ln -f dds2tar dds-dd
  120.  
  121. tar2tar: tar2tar.c
  122.     $(CC) tar2tar.c -o tar2tar
  123.  
  124. dds2index: dds2index.o $(OBJ)
  125.     $(CC) dds2index.o $(OBJ)  -o dds2index
  126.  
  127. mt-dds: mt-dds.o $(OBJ)
  128.     $(CC) mt-dds.o $(OBJ)  -o mt-dds
  129.  
  130. dds-dd: dds-dd.o $(OBJ)
  131.     $(CC) dds-dd.o $(OBJ)  -o dds-dd
  132.  
  133. install: dds2tar ddstool \
  134.     dds2tar.$(MANEXT) mt-dds.$(MANEXT) dds2index.$(MANEXT) dds-dd.$(MANEXT)
  135.     install -c -s dds2tar $(BINDIR)
  136.     install -c ddstool $(BINDIR)
  137.     ls -l $(BINDIR)/dds2tar $(BINDIR)/ddstool
  138.     install -c dds2tar.$(MANEXT)   $(MANDIR)/man$(MANEXT)
  139.     install -c dds2index.$(MANEXT) $(MANDIR)/man$(MANEXT)
  140.     install -c mt-dds.$(MANEXT)    $(MANDIR)/man$(MANEXT)
  141.     install -c dds-dd.$(MANEXT)    $(MANDIR)/man$(MANEXT)
  142.     ln -f $(BINDIR)/dds2tar  $(BINDIR)/dds2index
  143.     ln -f $(BINDIR)/dds2tar  $(BINDIR)/mt-dds
  144.     ln -f $(BINDIR)/dds2tar  $(BINDIR)/dds-dd
  145.  
  146. tar: dds2tar.ps dds2index.ps mt-dds.ps dds-dd.ps tar-1.11.8.patch
  147.     cd .. ; echo ' ' ; \
  148.         $(TAR) -R -c -f $(D).tar -v $(ARCHIVE) ;
  149.         echo ' '
  150.     ls -l ../$(D).tar
  151.     gzip -9 -f ../$(D).tar
  152.     ls -l ../$(D).tar.gz | awk '{print $$5}' > archive_length
  153.     sed s/LENGTH/`cat archive_length`/ <dds2tar.lsm |\
  154.            sed s/VERSION/$(V)/ > ../$(D).lsm
  155.     ls -l ../dds2tar*z ../dds2tar*.lsm
  156.     -rm -f ../dds2tar archive_length
  157.     cd .. ; ln -s $(D) dds2tar
  158.     echo ' '
  159.     cd .. ; tar zfc tar-1.11.8.1.tar.gz --totals tar-1.11.8.1
  160.     cd .. ; tar cf archive.tar ${D}.lsm ${D}.tar.gz ${T}.1.tar.gz
  161.  
  162. T=tar-1.11.8
  163. tar-patch tar-1.11.8.patch: 
  164.     cd .. ;  diff -ru ${T} ${T}.1 > $(D)/${T}.patch ; true
  165.     ls -l tar-*patch
  166.  
  167. .c.o:
  168.     $(CC) -c $< $(CCOPT) $(CCFLAGS)
  169.  
  170. .c.s:
  171.     $(CC) -S -c $< $(CCOPT) $(CCFLAGS)
  172.  
  173. .man.1:
  174.     umask 022 ; sed -e 's?/dev/tape?$(DEVICE)?' $< >$@
  175.  
  176. .man.ps:
  177.     umask 022 ; sed -e 's?/dev/tape?$(DEVICE)?' $< >$*.1
  178.     umask 022 ; groff -man $*.$(MANEXT)   > $*.ps
  179.  
  180. clean:
  181.     -rm -f $(OBJ) dds2tar.o dds2index.o mt-dds.o dds-dd.o *.BAK *.s
  182.     -rm -f dds2tar dds2index mt-dds dds-dd fio_test 
  183.     -rm -f *~ *.$(MANEXT) *.ps
  184.     -rm -f tags *.bak
  185.     chmod 644 *
  186.  
  187. doc:
  188.                     a2ps -p -nP    [A-Z]* *.h *.c *.lsm > a.ps
  189.     man dds2tar   | a2ps -p -nP -m -Hdds2tar            > b.ps
  190.     man dds2index | a2ps -p -nP -m -Hdds2index          > c.ps
  191.     man mt-dds    | a2ps -p -nP -m -Hmt-dds.man.ps      > d.ps
  192.     man dds-dd    | a2ps -p -nP -m -Hdds-dd.man.ps      > d.ps
  193.  
  194. psman: dds2tar.$(MANEXT) mt-dds.$(MANEXT) dds2index.$(MANEXT) dds-dd.$(MANEXT)
  195.     groff -man dds2tar.$(MANEXT)   > dds2tar.ps
  196.     groff -man dds2index.$(MANEXT) > dds2index.ps
  197.     groff -man mt-dds.$(MANEXT)    > mt-dds.ps
  198.     groff -man dds-dd.$(MANEXT)    > dds-dd.ps
  199.  
  200. dds_extract.o:dds_extract.c dds2tar.h dds_tape.h
  201. dds_index.o:dds_index.c dds2tar.h dds_tape.h
  202. dds_tape.o:dds_tape.c dds2tar.h dds_tape.h
  203. zf-cre-open.o:zf-cre-open.c zf-cre-open.h
  204.  
  205. INC=dds2tar.h dds_tape.h zf-cre-open.h
  206. dds2tar.o:dds2tar.c $(INC)
  207.     $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=DDS2TAR -o dds2tar.o
  208. dds2index.o:dds2tar.c $(INC)
  209.     $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=DDS2INDEX -o dds2index.o
  210. mt-dds.o:dds2tar.c $(INC)
  211.     $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=MTDDS -o mt-dds.o
  212. dds-dd.o:dds2tar.c $(INC)
  213.     $(CC) -c dds2tar.c $(CCOPT) $(CCFLAGS) -DPROGRAM=MTDDS -o dds-dd.o
  214.  
  215. fio_test:zf-cre-open.c zf-cre-open.h
  216.     cc zf-cre-open.c -DTEST -o fio_test
  217.  
  218. tags:
  219.     ctags -stv *.c
  220.  
  221.